var a = 0;

function doSomething(args, callback) {
	var i = 1;
	while(i <= 100) {
		a += i++;
	}
	process.nextTick(callback);
}

doSomething(function onEnd(){
	console.log(a);
});